package com.satan.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.satan.dto.PageDto;
import com.satan.dto.UserPwdDto;
import com.satan.entity.SysUser;
import com.satan.entity.response.ResCode;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.Map;

/**
* @author Demon
* @description 针对表【sys_user】的数据库操作Service
* @createDate 2023-10-03 20:53:34
*/
public interface SysUserService extends IService<SysUser> {

    SysUser getUserByName(String username);

    String getUserAuthority(Long userId);


    Map<String, Object> uploadAvatar(MultipartFile file) throws IOException;


    Map<String, Object> getPageList(PageDto pageDto);

    ResCode updateUserPwd(UserPwdDto userPwdDto, BCryptPasswordEncoder bCryptPasswordEncoder);

    boolean updateAvatar(SysUser sysUser);

    boolean saveOrUpdateUser(SysUser sysUser,BCryptPasswordEncoder bCryptPasswordEncoder);



    boolean deleteUserByIds(Long[] ids);

    boolean resetPassword(Integer id,BCryptPasswordEncoder bCryptPasswordEncoder);

    boolean updateStatus(Integer id, String status);
}
